<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        //Number.EPSILON 是js中表示的最小精度
        function equal(a,b){
            if(Math.abs(a-b)<Number.EPSILON){
                return true
            }else{
                return false
            }
        }
        console.log(equal(0.1+0.2,0.3))

        //Math.trunc去除小数点后面的部分
        console.log(Math.trunc(3.5))
        //Math.sign检测当前数值是正，负，0
        console.log(Math.sign(5))
        console.log(Math.sign(0))
        console.log(Math.sign(-5))
    </script>
</body>
</html>